{{extend 'layout.html'}}

<h2 class="fancy">PyForum - Update Category</h2>

{{include 'fadmin/admin_options.html'}}

{{include 'default/err_check.html'}}

<form id="add_cat_form" method="post">
<fieldset id="add_cat_form_fields">
    <input type="hidden" id="form_submitted" name="form_submitted" value="1" />
    <input type="hidden" id="cat_id" name="cat_id" value="{{=this_category.id}}" />
    <table cellspacing="2" cellpadding="2">
    <tbody>
        <tr>
            <td><span class="warning">[*]</span> Category Name:</td>
            <td><input type="text" id="cat_name" name="cat_name" value="{{=request.vars.get('cat_name', this_category.cat_name)}}" style="width:400px;" /></td>
        </tr>
        <tr>
            <td>Category Description:</td>
            <td>
                <textarea id="cat_desc" name="cat_desc" rows="0" cols="0"
                        style="width:400px;height:150px;">{{=request.vars.get('cat_desc', this_category.cat_desc)}}</textarea>
            </td>
        </tr>
        <tr>
            <td style="vertical-align:top;">Visiblility To</td>
            <td style="vertical-align:top;">
                <select id="cat_visible" name="cat_visible">
                    <option {{if request.vars.get('cat_visible', this_category.cat_visible_to) == forum_memberships['FORUM_ADMINISTRATOR']:}}selected="selected"{{pass}}
                            value="{{=forum_memberships['FORUM_ADMINISTRATOR']}}">Forum Administrators</option>
                    <option {{if request.vars.get('cat_visible', this_category.cat_visible_to) == '':}}selected="selected"{{pass}}
                            value="">Public</option>
                    <option {{if request.vars.get('cat_visible', this_category.cat_visible_to) == '%s,%s' % (forum_memberships['FORUM_ADMINISTRATOR'], forum_memberships['FORUM_MEMBER']):}}selected="selected"{{pass}}
                            value="{{=forum_memberships['FORUM_ADMINISTRATOR']}},{{=forum_memberships['FORUM_MEMBER']}}">Regular Forum Members (+Admins)</option>
                </select>
            </td>
        </tr>
    </tbody>
    </table>

    <div class="top-separator">
        <input type="submit" id="submit" name="update_cat" value="Update" />
        <input type="submit" id="cancel" name="cancel" value="Cancel" />
        &nbsp;&nbsp;
        <input type="submit" id="remove" name="remove" value="Remove this Category" />
    </div>
</fieldset>
</form>
